package com.guilin.controller.front;

import com.guilin.common.core.domain.AjaxResult;
import com.guilin.domain.Carousel;
import com.guilin.system.service.CarouselService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 轮播图前台
 */

@RestController
@RequestMapping("/carousel")
@Slf4j
public class CarouselControllerFront {

    @Autowired
    private CarouselService carouselService;

    /**
     * 获取轮播图
     * @return
     */
    @GetMapping("/getCarousel")
    public AjaxResult getCarousel(){

        Carousel carousel = new Carousel();
        carousel.setStatus("0");
        List<Carousel> carousels = carouselService.selectCarouselList(carousel);
        return AjaxResult.success(carousels);
    }
}
